<access_control grant="admin, dev">
    <div id="adminBar" style="left:0;position:fixed; top: 0;">
        <ul id="ufm__adminBar"> 
            <li><a href="<?= Erra_System_PageBuilder::makeLink('') ?>"><img src="<?= config_get('path.framework_images') ?>/cmsimages/homepage.png" />&nbsp;<?= __('To the homepage') ?></a></li>

            <li class="erra-std-adminbar-not_ajax">
                <span class="pointer live-click" id="switch-to-not-ajax" data-function="disable_ajax_navigation">
                    <?= '<img width=20 height=20 src="' . config_get('path.framework_images') . '/cmsimages/standard.png" /> ' . __('Disable AJAX navigation') ?>

                </span>
            </li>
            <li class="erra-std-adminbar-page_properties"><a href="#">
                    <?php
                    $routeName = Erra_System_PageBuilder::getCurrentPage();
                    $routeName = $routeName['routeName'];
                    $page = Erra_System_Factory::getFieldObject('Base_LayoutObject', '', 'SQL', 'WHERE page_url="' . $routeName . '"');
                    $pagePropertiesLink = '<img src="' . config_get('path.framework_images') . '/cmsimages/page_properties.png" /> ' . __('Page properties');
                    echo $page->_editInPlace('AdminAction/saveSqlReload', $pagePropertiesLink);
                    ?>
                </a>
            </li>

            <li class="erra-std-adminbar-object_properties"><a href="#"><img src="<?= config_get('path.framework_images') ?>/cmsimages/edit_objects.png" />&nbsp;<?= __('Edit contents') ?></a>
                <ul>
                    <?php
                    foreach (Erra_System_Factory::$adminFields as $editableFieldKey => $editableField) {
                        $icon = (strstr(get_class($editableField), 'Std_')) ? strtolower(get_class($editableField)) . '.png' : 'std_object.png';
                        $editInPlaceContent = '<img src="' . config_get('path.framework_images') . '/cmsimages/types/' . $icon . '"/>';
                        if (strlen($editableField->getHelp())) {
                            $editInPlaceContent .= '<span class="live-tipsy" title="' . security_clean_input($editableField->getHelp()) . '">' . $editableField->getDescription() . '</span>';
                        } else {
                            $editInPlaceContent .= $editableField->getDescription();
                        }
                        echo '<li class="hover-for-editable-object" data-object_id="' . $editableField->getObjectId() . '-'.$editableField->getTableName().'"><a href="#">';
                        echo $editableField->_editInPlace('AdminAction/saveSql', $editInPlaceContent);
                        echo '</li>';
                    }
                    ?>
                </ul>
            </li>
            <?php if (Erra_System_AccessControl::is('dev')) : ?>
                <li><img src="<?= config_get('path.framework_images') ?>/cmsimages/tools.png" />&nbsp;<?= __('Design tools') ?>
                    <ul>
                        <li class="erra-std-adminbar-toggle_regions"><span class="live-click pointer" data-function="toggle_region_view"><img src="<?= config_get('path.framework_images') ?>/cmsimages/regions.png" />&nbsp;<?= __('Toggle regions display') ?></span></li>

                        <li><a href="WEBROOT/__erra/externals/firefile/firefile.php"><img src="WEBROOT/__erra/externals/firefile/0.9.0.png" />&nbsp;<?= __('Configure FireFile') ?></a></li>

                     
                    </ul>
                </li>

            <?php endif; ?>

            <li>
                <a href="<?= Erra_System_PageBuilder::makeLink('config') ?>"><img src="<?= config_get('path.framework_images') ?>/cmsimages/config_panel_link.png" />&nbsp;<?= __('Config panel') ?></a>
                <ul>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/navigation') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/menubar.png" />&nbsp;<?= __('Handle navigation') ?></a></li>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/localize/traduction_list') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/translation.png" />&nbsp;<?= __('Translation list') ?></a></li>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/views') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/view.png" />&nbsp;<?= __('Edit views code') ?></a></li>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/layouts') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/template.png" />&nbsp;<?= __('Edit layouts code') ?></a></li>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/objects') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/objects.png" />&nbsp;<?= __('Edit objects code') ?></a></li>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/sql') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/sql.png" />&nbsp;<?= __('Database admin') ?></a></li>
                    <li><a href="<?= Erra_System_PageBuilder::makeLink('config/backups') ?>"><img src="<?= config_get('path.framework_images') ?>/admin/backup.png" />&nbsp;<?= __('Backups') ?></a></li>
                </ul>
            </li>

            <li style="float:right; margin-right:50px;"><a href="<?= Erra_System_PageBuilder::makeLink('config/disconnect') ?>"><img src="<?= config_get('path.framework_images') ?>/cmsimages/shutdown.png" />&nbsp;<?= __('Logout') ?></a></li>
        </ul>
    </div>
</access_control>